const express = require("express");
const router = express.Router();
const Commont = require("@controller/comment");

router.post("/write", (req, res, next) => {
  const { skey, content, bookid } = req.body;
  if (skey === undefined || content === undefined || bookid === undefined) {
    res.json({
      result: -2,
      errMsg: "缺少请求参数",
    });
    return;
  }

  Comment.addCommentBySkey(req, res, next);
});

module.exports = router;
